package com.lagou.edu.context.util;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;

/**
 * @Author zhaozuowen
 * @Description
 * @Date 2020/1/7 11:03
 **/

public class ResourceUtils {

    public static ClassLoader getClassLoader(){
        return Thread.currentThread().getContextClassLoader();
    }
    public static InputStream getResourceAsStream(String location){
        InputStream resourceAsStream = getClassLoader().getResourceAsStream(location);
        return resourceAsStream;
    }

    public static Enumeration<URL> getResources(String location) throws IOException {

        return getClassLoader().getResources(location);
    }
}
